app.controller('adminController', ['$scope','ajax','$state','$sessionStorage',function ($scope,ajax,$state,$sessionStorage) {
    $scope.username = $sessionStorage.username;
    $scope.logout=function(){
        ajax.post({
            url: 'back/logout',
        }).then(function(data){
            $sessionStorage.username ='';
            $state.go('login')
        })
    }
}]);